<template>
  <div>
    <div class="navbar-wrapper">
      <van-nav-bar title="立即购买" left-text="返回" @click-left="returnFn($route.query.item)" />
    </div>
    <div>
      <van-grid :border="false" :column-num="1" :gutter="10" direction="horizontal">
        <van-grid-item v-for="obj in $route.query.item" :key="obj.id" @click="productDetailsFn(obj)">
          <van-image :src="obj.img" />
          <p style="font-size: 20px" class="product_names">{{ obj.name }}</p>
          <div>
            <span style="font-size: 20px; color: #dd001b">￥{{ obj.price }}</span>
            <span style="font-size: 12px">销量：{{ obj.volume }}</span>
          </div>
        </van-grid-item>
      </van-grid>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {

    };
  },
  methods: {
    returnFn(val) {
      this.$router.push({
        path: "listdetails",
        query: {
          item: val
        }

      });
      console.log($route.query.item);
    }
  }
};
</script>
<style scoped></style>
